package com.demo.exception;

import com.demo.enums.BizExceptionEnum;

public class ServiceLayerException extends Exception {
	private static final long serialVersionUID = -1270887336222195431L;
	private Exception exception;
	private String code;
	private String msg;
	private BizExceptionEnum bizException;

	public ServiceLayerException(Exception exception, String code, String msg) {
		super();
		this.exception = exception;
		this.code = code;
		this.msg = msg;
	}
	public ServiceLayerException(String code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}
	public ServiceLayerException(Exception exception,
			BizExceptionEnum bizException) {
		super();
		this.exception = exception;
		this.code = bizException.getCode();
		this.msg = bizException.getMsg();
	}
	
	public ServiceLayerException(BizExceptionEnum bizException) {
		super();
		this.code = bizException.getCode();
		this.msg = bizException.getMsg();
	}
	public void setBizException(BizExceptionEnum bizException) {
		this.code = bizException.getCode();
		this.msg = bizException.getMsg();
	}

	public String getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}

	public Exception getException() {
		return exception;
	}

	public void setException(Exception exception) {
		this.exception = exception;
	}
	
	public BizExceptionEnum getBizException() {
		return bizException;
	}

}
